package com.sharemarking.wa.platform.mapper;

import com.sharemarking.wa.platform.dto.driver.DriverListDto;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author dxy
 */
@Repository
public interface DriverMapper {
    @Select("SELECT code FROM wa_order WHERE driver_id = #{driverId} AND type = 1")
    List<String> getCodeListByDriverId(Integer driverId);

    @Select("SELECT a.member_id AS driverId,a.name,b.mobile,a.exam_state,a.reject_reason,a.head_img " +
            "FROM wa_driver_verify a LEFT JOIN sys_member b ON a.member_id = b.id WHERE a.org_id = #{orgId} LIMIT #{pageIndex},#{pageSize}")
    List<DriverListDto> getDriverList(Map map);

    @Select("SELECT COUNT(*) FROM wa_driver_verify a LEFT JOIN sys_member b ON a.member_id = b.id WHERE a.org_id = #{orgId}")
    Integer getDriverListToatl(Map map);
}
